﻿/*
=============================================================================
Author:魏宝辉通过CodeSmithe生成
CreatedTime:2012-12-12
Description:UserList三层结构数据访问层
=============================================================================
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using PWMIS.DataMap.Entity;
using FTchina.Models;//引入模型层
namespace FTchina.DAL
{
	public static partial class UserListService
	{
		 
	 
			
		public static int DeleteUserListById(int id)	
		{     
            UserList userList = new UserList();
            userList.Id = id;
            EntityQuery<UserList> query = new EntityQuery<UserList>(userList);
             return query.Delete(userList);
		}	
        
          //以标识列获得对象
        public static UserList GetUserListById(int  id)
        {
            UserList userList = new UserList();
            userList.Id = id;
            EntityQuery<UserList> query = new EntityQuery<UserList>(userList);
            query.FillEntity(userList);
            return userList;
        }
		
	 
	 
       
        
        
        
		 
		 
		 public static int AddOrUpdateUserList(UserList userList)
        {
            UserList _userList = new UserList();

            EntityQuery<UserList> query = new EntityQuery<UserList>(_userList);
           _userList= userList;
           int i=(userList.Id==0)?
                 query.Insert(_userList): query.Update(_userList);
            return i;
        }
		
		 
	}
}

